from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required

from projects import views

urlpatterns = patterns('',
    url(r'^$', 
        views.project_list, 
        name='project_list'),
    url(r'^create/$', 
        login_required(views.create_project),
        name='create_project'),
    url(r'^(?P<project_slug>[-\w]+)/$', 
        views.project_detail, 
        name='project_detail'),
    url(r'^(?P<project_slug>[-\w]+)/members/$',
        views.member_list,
        name='member_list'),
    url(r'^(?P<project_slug>[-\w]+)/members/add/$',
        login_required(views.add_members),
        name='add_members'),
    (r'^(?P<project_slug>[-\w]+)/issues/', include('issues.urls')),
    (r'^(?P<project_slug>[-\w]+)/', include('events.urls')),
)